import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login'
import Home from '../components/Home' // 引入Home.vue，.vue后缀可以省略不写
import Detail from '@/components/Detail'
import Register from '@/components/Register'

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    { path: '/', component: Home }, // 访问/时跳转到Home.vue组件
    { path: '/login', component: Login }, // 配置登录页面路由
    { path: '/home', component: Home }, // 配置首页路由
    { path: '/detail',name: 'Detail', component: Detail }, // 配置首页路由
    { path: '/register', component: Register }, // 配置注册路由
  ]
})
